# load packages

pacman::p_load(tidyverse, scales)

### figure A.6 (estimated share of pools crimes by foreigners) ----

# load data
pools <- read_rds("data/survey.rds")

# create plot
ggplot(pools, aes(estimate_violence_share_foreigners/100)) +
    geom_histogram(binwidth = 0.15, color = "black") +
    theme_bw() +
    geom_vline(xintercept = .6, color = "red") +
    geom_vline(xintercept = .31, color = "darkblue", lty = 2) +
    ggtitle(element_blank()) +
    theme(
        panel.grid.major = element_blank(), 
        panel.grid.minor = element_blank() 
    ) +
    ylab("Count") +
    xlab("Estimated Share Foreigners") +
    theme(text = element_text(size = 16)) +
    scale_x_continuous(labels = percent)

# clean
rm(list = ls())